<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_data_tables.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->
<head>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">


	<title>日志管理</title>
	<meta name="keywords" content="">
	<meta name="description" content="">

	<link href="${ctx}/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
	<link href="${ctx}/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

	<!-- Data Tables -->
	<link href="${ctx}/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
	<link href="${ctx}/css/plugins/iCheck/custom.css" rel="stylesheet">
	<link href="${ctx}/css/animate.min.css" rel="stylesheet">
	<link href="${ctx}/css/style.min862f.css?v=4.1.0" rel="stylesheet">
	<link href="${ctx}/css/plugins/datapicker/datepicker3.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox float-e-margins">

				<div class="ibox-content">
					<div class="text-center">
						<form class="form-inline">
							<div class="form-group" id="data_5">
								<label class="font-noraml">范围选择</label>
								<div class="input-daterange input-group" id="datepicker">
									<input type="text" class="input-sm form-control" id="startTime" name="startTime"
									       value="2017-11-11"/>
									<span class="input-group-addon">到</span>
									<input type="text" class="input-sm form-control" id="endTime" name="endTime"
									       value="${.now?string["YYYY-MM-dd"]}"/>
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-3">
									<input type="text" class="form-control" placeholder="请输入用户名称" id="username"/>
								</div>
							</div>
							<div class="form-group">
								<button class="btn btn-success" type="button" id="search"><i
										class="glyphicon glyphicon-search"></i>&nbsp;搜日志
								</button>
							</div>
							<div class="form-group">
								<button class="btn btn-default" type="button" id="clear"><i
										class="glyphicon glyphicon-remove"></i>&nbsp;清理日志
								</button>
							</div>
						</form>
					</div>
					<table class="table table-striped table-bordered table-hover loggerDataTable">
						<thead>
						<tr>
							<th width="40">
								<label class="i-checks">
									<input type="checkbox" id="paper_check" name="" value=""/>
								</label>
							</th>
							<th>操作内容</th>
							<th>操作用户</th>
							<th>模块</th>
							<th>操作时间</th>
							<th>操作人IP</th>
						</tr>
						</thead>
					</table>
				</div>
			</div>
		</div>
	</div>

</div>
<script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${ctx}/js/plugins/dataTables/jquery.dataTables.min.js"></script>
<script src="${ctx}/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="${ctx}/js/content.min.js?v=1.0.0"></script>
<script src="${ctx}/js/plugins/iCheck/icheck.min.js"></script>
<script src="${ctx}/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="${ctx}/js/plugins/layer/layer.js"></script>
<script>
	var loggerDataTable;
	$(function () {
		loggerDataTable = $('.loggerDataTable').dataTable({
			"bStateSave": true, //状态保存
			"bLengthChange": false,
			"bFilter": false,
			"serverSide": true,
			"iDisplayLength": 7,
			"aoColumnDefs": [{"bSortable": false, "aTargets": [0]}],
			"bScrollCollapse": true, //高度自适应
			"aaSorting": [[1, "asc"]],
			"ajax": {
				url: "${ctx}/logger/list",
				type: "GET",
				cache: false,
				data: function (d) {
					d.startTime = $("#startTime").val();
					d.endTime = $("#endTime").val();
					d.username = $("#username").val();
				}
			},
			"columns": [{
				"render": function (data, type, row, meta) {
					return "<label class='i-checks'><input type='checkbox' name='paperId'/></label>";
				}
			}, {
				"data": "operate",
			}, {
				"data": "username",
			}, {
				"data": "moduleName",
			}, {
				"data": "time",
			}, {
				"data": "ip"
			}],
		}).api();
		$('#search').click(function () {
			loggerDataTable.ajax.reload();
		});
	})

	$(document).ajaxComplete(function () {
		$('input[type=checkbox]').iCheck({
			checkboxClass: "icheckbox_square-green",
			radioClass: "iradio_square-green"
		});

	});
	$(function () {
		$("#data_5 .input-daterange").datepicker({keyboardNavigation: !1, forceParse: !1, autoclose: !0});
		$("#clear").click(function () {
			layer.confirm('确认要清空日志吗？', function (index) {
				$.get('${ctx}/logger/clear', function (data) {
					var result = data.status;
					if (result == "1001") {
						layer.alert('清空成功!', {
							icon: 1,
							skin: 'layer-ext-moon'
						},function(){
							setTimeout(function () {
								window.location.reload();
							}, 500);
						})
					} else {
						layer.alert('清空失败!', {
							icon: 2,
							skin: 'layer-ext-moon'
						})
					}
				})
			})
		})
	})
</script>

</body>

</html>
